x86emul: tighten CLFLUSH emulation
authorJan Beulich <jbeulich@suse.com>
Mon, 12 Jan 2015 14:41:12 +0000 (15:41 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 12 Jan 2015 14:41:12 +0000 (15:41 +0100)
commit9d03db6b81d1880bf3aa4fc83a60346bf02be251
tree6cd36a8642d0327fbe1ac49099b317f0b03f3b1a
parentcacdb0faaa121ac8f792d5bd34cc6bc7c72d21da
x86emul: tighten CLFLUSH emulation

While for us it's not as bad as it was for Linux, their commit
13e457e0ee ("KVM: x86: Emulator does not decode clflush well", by
Nadav Amit <namit@cs.technion.ac.il>) nevertheless points out two
shortcomings in our code: opcode 0F AE /7 is clflush only when it uses
a memory mode (otherwise it's SFENCE) and when there's no REP prefix
(an operand size prefix is fine, as that's CLFLUSHOPT).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/x86_emulate/x86_emulate.c